package com.example.tnot.Teacher.ActivityConfig.adapter;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.example.tnot.Teacher.CoursePart.Container.CourseFragment;
import com.example.tnot.Teacher.Homepart.Container.HomeFragment;
import com.example.tnot.Teacher.Messagepart.Container.ContainerHome.MessageFragment;
import com.example.tnot.Teacher.MinePart.container.MeFragment;

public class ViewPagerAdapter extends FragmentStateAdapter{
    public ViewPagerAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        switch (position) {
            case 0:
                return HomeFragment.newInstance(null, null);
            case 1:
                return CourseFragment.newInstance(null,null);
            case 2:
                return MessageFragment.newInstance(null, null);
            case 3:
                return MeFragment.newInstance(null, null);
            default:
                return HomeFragment.newInstance(null, null);
        }
    }

    @Override
    public int getItemCount() {
        return 4;
    }
}
